import requests
from lxml import etree

url = 'http://www.sucaijishi.com/icon/'
res = requests.get(url)
print(res.status_code)

res.encoding = res.apparent_encoding

xhtml = etree.HTML(res.text)
tupian = xhtml.xpath("//div[@class='w1180px common_list pt150']/ul/li/a/img/@src")
#print(tupian)
tupianname = xhtml.xpath("//div[@class='title ']/a/text()")
#print(tupianname)

for i,j in zip(tupian,tupianname):
    res = requests.get(i)
    data = res.content
    name = j + '.jpg'
    print(name)
    with open(name, 'wb') as f:
        f.write(data)